package com.qiaoan.back.enums;

/**
 * @See 处理结果状态值
 * Created by eversec on 2017/5/12.
 */
public enum ResultCode {

    /**
     * 失败(0)
     */
    Fail {
        @Override
        public int getCode() {
            return -1;
        }
    },

    /**
     * 成功(1)
     */
    Success {
        @Override
        public int getCode() {
            return 1;
        }
    };


    @Override
    public String toString() {
        return String.valueOf(this.getCode());
    }

    public abstract int getCode();

    public int getValue() {
        return this.ordinal();
    }
}
